<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
session_start();
class Comment extends CI_Controller {
	function __construct()
	    {
		parent::__construct();
		$this->load->helper('url');
		$this->load->helper(array('form', 'url'));
		$this->load->library('form_validation');
		$this->load->library('session');
                $this->load->model('mod_clinic');
                $this->load->model('mod_comment');
                $this->load->library('lang');
                $this->load->library('input');
	    }
        function index(){
            $id_cli = $_SESSION['idid'];
            $lg = $_SESSION['lg'];
            if($id_cli!=''||$lg!=''){
                $this->lang->load('header',$lg);
                $this->lang->load('lien',$lg);
                $this->lang->load('container',$lg);
                $this->lang->load('footer',$lg);
                $pays = $this->input->post('pays');
                $data['poster']=$this->mod_comment->getPostByIdClinic($id_cli);
                $data['id_clinic']=$id_cli;
                $this->load->view('clinic/vue_step_commentaires',$data);
            } 
            }
       function delComment(){
           $id_com=$this->input->get('id_com');
           if($id_com!=''){
           $this->mod_comment->delComment($id_com);
           echo 1;
           } else {
               echo 0;
           }
           
       }
       function validComment(){
           $id_com=$this->input->get('id_com');
           if($id_com!=''){
               $resultat = $this->mod_comment->validComment($id_com);
               echo 1;
           }
           else {
               echo 0;
           }
           
           
       }
}